package uz.edo.app.client.core;

import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.wicket.Request;
import org.apache.wicket.protocol.http.WebSession;
import uz.edo.db.bean.User;

public class MySession extends WebSession implements HttpSessionListener {

	private static final long serialVersionUID = -4610131865544752428L;
	private static Log _log = LogFactory.getLog(MySession.class);
    private User user;
    private String session_id;

    public MySession(Request request)
    {
        super(request);
    }
   public String getSession_id()
    {
        return session_id;
    }
    public void setSession_id(String session_id)
    {
        this.session_id = session_id;
    }
    public boolean isLoged()
    {
        return user != null;
    }
    public User getUser()
    {
        return user;
    }
    public void setUser(User user)
    {
        this.user = user;
    }
    public void sessionCreated(HttpSessionEvent httpSessionEvent)
    {
        _log.info("session created");
    }
    public void sessionDestroyed(HttpSessionEvent httpSessionEvent)
    {
        _log.info("session expired");
    }

}
